<template>
  <div style="display:inline-block">
    <el-button type="danger" @click="del()">删除</el-button>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    del() {
      this.$confirm("确定要删除这条数据吗", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
            this.$emit('del',this.delId)
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    }
  },
  props: ["delId"]
};
</script>

<style>
</style>